home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / answrbok / 7_10.lha / 7_10 / p_result.c < prev    next >
Text File  |  1993-08-08  |  828b  |  30 lines

  1. * Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
  2. * The C++ Answer Book */
  3. * Tony Hansen */
  4. * All rights reserved. */
  5. include <process.h>
  6. include <debug.h>    /* DELETE */
  7. / wait for termination and retrieve result
  8. ong process::result()
  9.  
  10.    if (debug) /*DELETE*/ cerr << "process" << this << "::result()\n";
  11.    if (mustrecurse())
  12. return result();
  13.  
  14.    else
  15. {
  16. if (this == t_thisprocess)
  17.     error("result called for this_process");
  18. if (debug) /*DELETE*/ cerr << "\t" << this << "->t_curstate == " << ps_print(t_curstate) << "\n";
  19.  
  20. while (t_curstate != TASK_TERMINATED)
  21.     {
  22.     t_thisprocess->pause(this);
  23.     if (debug) /*DELETE*/ cerr << "\t" << this << "->t_curstate == " << ps_print(t_curstate) << "\n";
  24.     }
  25.  
  26. if (debug) /*DELETE*/ cerr << "<<<< process" << this << "::result()\n";
  27. return t_result;
  28. }
  29.  
  30.